﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace BismillahReader
{
    public partial class TranslationSource : PhoneApplicationPage
    {
        public TranslationSource()
        {
            InitializeComponent();
            lstTranslations.ItemsSource = BismillahReader.Core.AvailableTranslation.GetTranslations();
        }

        private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
        {
            HyperlinkButton btn = e.OriginalSource as HyperlinkButton;
            if (btn != null)
            {
                BismillahReader.Core.AvailableTranslation translation = btn.DataContext as BismillahReader.Core.AvailableTranslation;
                AppContext.CurrentTranslation = translation;
                AppContext.Translation = null;
                NavigationService.Navigate(new System.Uri("/Main.xaml", System.UriKind.Relative));
            }

        }
    }
}